import React,{useContext, useEffect} from "react";
import conText from '@/utils/myredux'

export default  () => {
  const { state, dispatch }  =  useContext(conText)

  useEffect(()=>{
      console.log('state...',state);
  },[]);
  return (
    <div>
        name:{state.name} <br/>
        age:{state.age} <br/>
        someMes:{state.someMes} <br/>
        <button onClick={()=>{dispatch({type:'increment',payload:++state.age})}}> 改变state</button>
    </div>
   )}



